
import Vue from 'vue';
import axios from 'axios';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from './App';
import router from './router';
import store from './vuex/store';
import httpApi from "./api/api.js";
import { baseUrl } from '@/api/http'

/*共用css-js*/
import "./assets/css/base.css";
/* 适配 */
import 'lib-flexible';
/*拖拽*/
import  "./utils/drag.js";
/*兼容模式*/
import 'babel-polyfill';
import 'url-search-params-polyfill';
/*字体图标*/
import '../static/iconfont/iconfont.css';

/*图片预览开始*/
import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'
Vue.use(Viewer);
Viewer.setDefaults({
  Options: { "inline": true, "button": true, "navbar": true, "title": true, "toolbar": true, "tooltip": true, "movable": true, "zoomable": true, "rotatable": true, "scalable": true, "transition": true, "fullscreen": true, "keyboard": true, "url": "data-source" }
});
/*图片预览结束*/

import MarkdownIt from 'markdown-it';

// 创建markdown解析实例
Vue.prototype.$md = new MarkdownIt({
  html: true,       // 允许解析HTML标签
  linkify: true,    // 自动识别URL并转换为链接
  typographer: true // 启用一些智能引号和符号替换
});
  import CryptoJS from 'crypto-js';
// 定义全局方法
Vue.prototype.$AesEncrypt = function(data) {
 let  jm= CryptoJS.AES.encrypt(CryptoJS.enc.Utf8.parse(data), CryptoJS.enc.Utf8.parse("ABCDABCDABCD"),{
                   mode: CryptoJS.mode.ECB,
           padding: CryptoJS.pad.Pkcs7
                 }).ciphertext.toString()

                 return jm
};


import Router from 'vue-router'
import QS from "qs"
import echarts from 'echarts';


const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}
Vue.use(ElementUI);
Vue.prototype.$ajax = axios
Vue.prototype.$httpApi = httpApi;
Vue.prototype.$echarts = echarts;
Vue.prototype.$baseUrl = baseUrl

Vue.config.productionTip = false;
new Vue({
    el: '#app',
    router,
    store,
    components: { App },
    template: '<App/>',
    data: {
        Bus: new Vue()
    }
})
